# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=python-trio-asyncio
pkgver=0.12.0
pkgrel=9
pkgdesc='A re-implementation of the asyncio mainloop on top of Trio'
arch=(any)
url=https://github.com/python-trio/trio-asyncio
license=(
  APACHE
  MIT
)
depends=(
  python
  python-async_generator
  python-outcome
  python-trio
)
makedepends=(
  git
  python-setuptools
  python-pytest-runner
)
_tag=970d81c498f857d052738a2c4db2c899910dc038
source=(git+https://github.com/python-trio/trio-asyncio.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd trio-asyncio
  git describe --tags | sed 's/^v//'
}

build() {
  cd trio-asyncio
  python setup.py build
}

package() {
  cd trio-asyncio
  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  rm -rf "${pkgdir}"${site_packages}/tests
  install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/python-trio-asyncio/
  install -Dm 644 LICENSE.MIT -t "${pkgdir}"/usr/share/licenses/python-trio-asyncio/
}

# vim: ts=2 sw=2 et:
